/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author sarunaskujalis
 */
public class Journal {
    
    public Journal() {
        
    }
    
    public void log(String from, String to, String message) throws IOException {
        File file = new File(from+"_"+to+".txt");
        if (!file.exists()) {
            file.createNewFile();
        }
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(from+"_"+to+".txt", true)));
        out.println(from+" to "+to+": "+message);
        out.close();
    }
}
